﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace SurfaceNodeBattle
{
    class Line
    {
        private Vector2 start;
        private Vector2 stop;
        //line = a + bx
        private float lineB;
        private float lineA;

        #region Getters/setters

        public Vector2 Start
        {
            get { return start; }
            set { start = value; }
        }
        public Vector2 Stop
        {
            get { return stop; }
            set { stop = value; }
        }
        public float LineA { get { return lineA; } }
        public float LineB { get { return lineB; } }

        #endregion

        public void CalculateLineExpression()
        {
            lineB = (start.Y - stop.Y) / (start.X - stop.X);
            lineA = start.Y - lineB * start.X;
        }

        public Line(Vector2 lstart, Vector2 lstop)
        {
            start = lstart;
            stop = lstop;
            CalculateLineExpression();
        }
    }
}
